<?php

use Biz\service\Album\AlbumRecommendService;
use Doraemon\service\statSign\Basic as statSign;
use Doraemon\tools\BlockType;

/**
 * 好物频道推荐清单
 * Class AlbumListAction
 */
class AlbumListAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_NOTHING;

    public function main()
    {
        $recommend = AlbumRecommendService::squareRecommend();
        $i = 1;
        foreach ($recommend as $key => $row) {
            $recommend[$key]['statSign'] = statSign::genStatSign(statSign::MODULE_FINE_GOODS_ALBUM_LIST, [
                    statSign::EXTEND_KEY_OBJ_ID => $row['album_info']['album_id'],
                    statSign::EXTEND_KEY_OBJ_TYPE => BlockType::TYPE_WIKI_ALBUM,
                    statSign::EXTEND_KEY_INDEX => $i
                ]
            );
            $i++;
        }
        $this->setSuccess(['album_list' => $recommend, 'more_album_link' => \Doraemon\pockets\constInterface\LinkConf::LINK_APP_WIKI_EXPLORE]);
    }


}